package com.example.finger.util;

import android.ndk.AdTest.AdLoad;

/**
 * Created by LYX on 2018/11/22.
 */

public class MatchFinger {
    public static boolean match(byte[] finger, byte[] temp){
        int	w_nRet = 0;
        int[]	w_nMatchRes = new int[1];
        int	w_nSecLevel = 3;

        w_nRet = new AdLoad().FPMatch(subBytes(finger), subBytes(temp), w_nSecLevel, w_nMatchRes, null);
        if ((w_nRet == 0) && (w_nMatchRes[0] == 1))
        {
           return true;
        }
        else
        {
            return false;
        }
    }

    public static byte[] subBytes(byte[] src) {
        byte[] bs = new byte[570];
        System.arraycopy(src, 0, bs, 0, 570);
        return bs;
    }
}
